const mongoose = require('mongoose')
const Schema = mongoose.Schema
const ArticleSchema = new Schema({
  subTitle: String, // 子标题
  content: String, // 内容
  nickName: String, // 昵称
  avatarUrl: { // 头像
    type: String,
    default: 'http://cs-static-assets.oss-cn-beijing.aliyuncs.com/ds_system/errorimg.png'
  },
  createTime: { // 创建时间
    type: Date,
    default: Date.now
  },
  commentCount: {
    type: Number,
    default: 0
  }
})

// 发布模型
mongoose.model('Article', ArticleSchema)
